package com.cyq.day06;

public class ClassWork01 {
    public static void main(String[] args) {
        //声明一个5X5的二维数组
        int[][] ary = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20}, {21, 22, 23, 24, 25}};
        int max1 = 0;
        int max2 = 0;
        for (int i = 0; i < ary.length; i++) {
            for (int j = 0; j < ary[i].length; j++) {
                if (i == j) {
                    max1 += ary[i][j];
                }else  if(i+j==4){
                    max2 += ary[i][j];
                }
            }
        }
        int max = max2 + max1 ;
        System.out.println(max);
    }
}
